﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.BLL;
using Grove.ORM;
using HZ.MBSM.Model;
using HZ.MBSM.DBUtility;

public partial class Bidder_BuyProjectlist : System.Web.UI.Page, IPageDescribe
{
    public string strUl = "gggg";
    protected void Page_Load(object sender, EventArgs e)
    {
        //跳转页面
        //MsgBox.Aert_history("此功能暂时还没有开通", -1);
        //return;
        if (HZ.MBSM.BLL.Login.CheckAssert(this.UseAccountType))
        {
            HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
            if (_Account != null)
            {
                if (_Account.Sort == "0")
                {
                    //  strUl = "../Supervise/TraCompanySC.aspx?ProjectId=";   09/14 马
                    strUl = "TraLookbidProduct.aspx?ProjectId=";
                }
                else
                {
                    strUl = "TraLookbidProduct.aspx?ProjectId=";
                }
                Int64 AccountId_TBR;
                System.Data.IDataReader dr;
                string check = "";
                string sql = "";
                AccountId_TBR = SysFun.ToLong(_Account.AccountId);
                Db db = new Db();

                //如果审核未通过，弹出未通过审核的药品
                sql = "select count(*) as cun from company where CheckStatus='2' and accountid=" + AccountId_TBR.ToString();
                dr = db.DataReader(sql);
                while (dr.Read())
                {
                    check = dr["cun"].ToString();
                }
                dr.Close();
                dr.Dispose();
                db.Close();
                if (check != "0")
                    Response.Write("<script>window.open('ComNoPass.aspx');</script>");
            }


            GetProjectData();
        }
    }
   
    public void GetProjectData()
    {
        AgencyBiding Agb = new AgencyBiding();
        DataTable dt = Agb.GetBidProjectDataTable();
        GridView1.DataSource = dt.DefaultView;
        GridView1.DataBind();
        dt.Dispose();
    }

    #region IPageDescribe 成员


    public string Describe
    {
        get { return "交易项目列表"; }
    }
    public string Name
    {
        get { return "交易项目列表"; }
    }
    public string ParentName
    {
        get { return "交易系统"; }
    }

    public System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> UseAccountType
    {
        get
        {
            System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
            _AccountType.Add(HZ.MBSM.DAL.AccountType.enumCompany);
            return _AccountType;
        }
    }

    #endregion
}
